<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Luat开源项目脚本lib</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>script_LuaTask lib</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>


<h2>Modules</h2>
<ul class="nowrap">
  <li><a href="../modules/aLiYun.html">aLiYun</a></li>
  <li><a href="../modules/aLiYunOta.html">aLiYunOta</a></li>
  <li><a href="../modules/agps.html">agps</a></li>
  <li><a href="../modules/agpsHxxt.html">agpsHxxt</a></li>
  <li><a href="../modules/agpsZkw.html">agpsZkw</a></li>
  <li><a href="../modules/audio.html">audio</a></li>
  <li><a href="../modules/cc.html">cc</a></li>
  <li><a href="../modules/clib.html">clib</a></li>
  <li><a href="../modules/common.html">common</a></li>
  <li><a href="../modules/console.html">console</a></li>
  <li><a href="../modules/errDump.html">errDump</a></li>
  <li><a href="../modules/ftp.html">ftp</a></li>
  <li><a href="../modules/gps.html">gps</a></li>
  <li><a href="../modules/gpsHxxt.html">gpsHxxt</a></li>
  <li><a href="../modules/gpsZkw.html">gpsZkw</a></li>
  <li><a href="../modules/http.html">http</a></li>
  <li><a href="../modules/lbsLoc.html">lbsLoc</a></li>
  <li><a href="../modules/led.html">led</a></li>
  <li><a href="../modules/link.html">link</a></li>
  <li><a href="../modules/log.html">log</a></li>
  <li><a href="../modules/misc.html">misc</a></li>
  <li><a href="../modules/mqtt.html">mqtt</a></li>
  <li><a href="../modules/net.html">net</a></li>
  <li><a href="../modules/netLed.html">netLed</a></li>
  <li><a href="../modules/ntp.html">ntp</a></li>
  <li><a href="../modules/nvm.html">nvm</a></li>
  <li><a href="../modules/patch.html">patch</a></li>
  <li><a href="../modules/pb.html">pb</a></li>
  <li><a href="../modules/pins.html">pins</a></li>
  <li><a href="../modules/pm.html">pm</a></li>
  <li><a href="../modules/powerKey.html">powerKey</a></li>
  <li><a href="../modules/record.html">record</a></li>
  <li><a href="../modules/ril.html">ril</a></li>
  <li><a href="../modules/scanCode.html">scanCode</a></li>
  <li><a href="../modules/sim.html">sim</a></li>
  <li><a href="../modules/sms.html">sms</a></li>
  <li><strong>socket</strong></li>
  <li><a href="../modules/sys.html">sys</a></li>
  <li><a href="../modules/uiWin.html">uiWin</a></li>
  <li><a href="../modules/update.html">update</a></li>
  <li><a href="../modules/utils.html">utils</a></li>
  <li><a href="../modules/websocket.html">websocket</a></li>
  <li><a href="../modules/wifiScan.html">wifiScan</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>socket</code></h1>
<p>模块功能：数据链路激活、SOCKET管理(创建、连接、数据收发、状态维护)</p>
<p></p>
    <h3>Info:</h3>
    <ul>
        <li><strong>Copyright</strong>: openLuat</li>
        <li><strong>Release</strong>: 2017.9.25</li>
        <li><strong>License</strong>: MIT</li>
        <li><strong>Author</strong>: openLuat</li>
    </ul>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#tcp">
    tcp (<strong  style="color: gray;">[ssl=nil]</strong><strong  style="color: gray;">[, cert=nil]</strong>)
    </a></td>
	<td class="summary">创建基于TCP的socket对象</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#udp">
    udp ()
    </a></td>
	<td class="summary">创建基于UDP的socket对象</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#mt:connect">
    mt:connect (address, port<strong  style="color: gray;">[, timeout=120]</strong>)
    </a></td>
	<td class="summary">连接服务器</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#mt:asyncSelect">
    mt:asyncSelect (<strong  style="color: gray;">[keepAlive=nil]</strong><strong  style="color: gray;">[, pingreq=nil]</strong>)
    </a></td>
	<td class="summary">异步发送数据</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#mt:asyncSend">
    mt:asyncSend (data<strong  style="color: gray;">[, timeout=nil]</strong>)
    </a></td>
	<td class="summary">异步缓存待发送的数据</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#mt:asyncRecv">
    mt:asyncRecv ()
    </a></td>
	<td class="summary">异步接收数据</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#mt:send">
    mt:send (data<strong  style="color: gray;">[, timeout=120]</strong>)
    </a></td>
	<td class="summary">同步发送数据</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#mt:recv">
    mt:recv (<strong  style="color: gray;">[timeout=0]</strong><strong  style="color: gray;">[, msg=nil]</strong><strong  style="color: gray;">[, msgNoResume=nil]</strong>)
    </a></td>
	<td class="summary">同步接收数据</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#mt:close">
    mt:close ()
    </a></td>
	<td class="summary">主动关闭并且销毁一个socket</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#setTcpResendPara">
    setTcpResendPara (<strong  style="color: gray;">[retryCnt=4]</strong><strong  style="color: gray;">[, retryMaxTimeout=16]</strong>)
    </a></td>
	<td class="summary">设置TCP层自动重传的参数</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#setDnsParsePara">
    setDnsParsePara (<strong  style="color: gray;">[retryCnt=4]</strong><strong  style="color: gray;">[, retryTimeoutMulti=4]</strong>)
    </a></td>
	<td class="summary">设置域名解析参数
 注意：0027以及之后的core版本才支持此功能</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#printStatus">
    printStatus ()
    </a></td>
	<td class="summary">打印所有socket的状态</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#setLowPower">
    setLowPower (tm)
    </a></td>
	<td class="summary">设置数据传输后，允许进入休眠状态的延时时长
 3024版本以及之后的版本才支持此功能
 此功能设置的参数，设置成功后，掉电会自动保存</td>
	</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#isReady">
    isReady
    </a></td>
	<td class="summary">SOCKET 是否有可用</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Functions"></a>Functions</h2>

    <dl class="function">
    <dt>
    <a name = "tcp"></a>
    <strong  style="color: red;">
    tcp (<strong  style="color: green;">[ssl=nil]</strong><strong  style="color: green;">[, cert=nil]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">创建基于TCP的socket对象</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">ssl</span>
            <span class="types"><span class="type">bool</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example">是否为ssl连接，true表示是，其余表示否</pre>
        </li>
        <li><span class="parameter">cert</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example">ssl连接需要的证书配置，只有ssl参数为true时，此参数才有意义，cert格式如下：
 {
     caCert = "ca.crt", --CA证书文件(Base64编码 X.509格式)，如果存在此参数，则表示客户端会对服务器的证书进行校验；不存在则不校验
     clientCert = "client.crt", --客户端证书文件(Base64编码 X.509格式)，服务器对客户端的证书进行校验时会用到此参数
     clientKey = "client.key", --客户端私钥文件(Base64编码 X.509格式)
     clientPassword = "123456", --客户端证书文件密码[可选]
 }</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">client，创建成功返回socket客户端对象；创建失败返回nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">c = socket.tcp()
c = socket.tcp(<span class="keyword">true</span>)
c = socket.tcp(<span class="keyword">true</span>, {caCert=<span class="string">"ca.crt"</span>})
c = socket.tcp(<span class="keyword">true</span>, {caCert=<span class="string">"ca.crt"</span>, clientCert=<span class="string">"client.crt"</span>, clientKey=<span class="string">"client.key"</span>})
c = socket.tcp(<span class="keyword">true</span>, {caCert=<span class="string">"ca.crt"</span>, clientCert=<span class="string">"client.crt"</span>, clientKey=<span class="string">"client.key"</span>, clientPassword=<span class="string">"123456"</span>})</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "udp"></a>
    <strong  style="color: red;">
    udp ()
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">创建基于UDP的socket对象</pre>



    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">client，创建成功返回socket客户端对象；创建失败返回nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">c = socket.udp()</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "mt:connect"></a>
    <strong  style="color: red;">
    mt:connect (address, port<strong  style="color: green;">[, timeout=120]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">连接服务器</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">address</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example"> 服务器地址，支持ip和域名</pre>
        </li>
        <li><span class="parameter">port</span>
        <pre class="example"> string或者number类型，服务器端口</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 120]
        <pre class="example"> 可选参数，连接超时时间，单位秒</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>
        <li>
        <pre class="example">bool result true - 成功，false - 失败</pre></li>
        <li>
        <pre class="example">string ,id '0' -- '8' ,返回通道ID编号</pre></li>
    </ol>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">socketClient = socket.tcp()
socketClient:connect(<span class="string">"www.baidu.com"</span>,<span class="string">"80"</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "mt:asyncSelect"></a>
    <strong  style="color: red;">
    mt:asyncSelect (<strong  style="color: green;">[keepAlive=nil]</strong><strong  style="color: green;">[, pingreq=nil]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">异步发送数据</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">keepAlive</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example">服务器和客户端最大通信间隔时间,也叫心跳包最大时间,单位秒</pre>
        </li>
        <li><span class="parameter">pingreq</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example">心跳包的字符串</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">boole,false 失败，true 表示成功</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">socketClient = socket.tcp()
socketClient:connect(<span class="string">"www.baidu.com"</span>,<span class="string">"80"</span>)
<span class="keyword">while</span> socketClient:asyncSelect() <span class="keyword">do</span> <span class="keyword">end</span></pre></il>
    </ul>

</dd>
    <dt>
    <a name = "mt:asyncSend"></a>
    <strong  style="color: red;">
    mt:asyncSend (data<strong  style="color: green;">[, timeout=nil]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">异步缓存待发送的数据</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">data</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example"> 数据</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example"> 可选参数，发送超时时间，单位秒；为nil时表示不支持timeout</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">result true - 成功，false - 失败</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">socketClient = socket.tcp()
socketClient:connect(<span class="string">"www.baidu.com"</span>,<span class="string">"80"</span>)
socketClient:asyncSend(<span class="string">"12345678"</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "mt:asyncRecv"></a>
    <strong  style="color: red;">
    mt:asyncRecv ()
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">异步接收数据</pre>



    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">data 表示接收到的数据(如果是UDP，返回最新的一包数据；如果是TCP,返回所有收到的数据)
              ""表示未收到数据</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">socketClient = socket.tcp()
socketClient:connect(<span class="string">"www.baidu.com"</span>,<span class="string">"80"</span>)
data = socketClient:asyncRecv()</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "mt:send"></a>
    <strong  style="color: red;">
    mt:send (data<strong  style="color: green;">[, timeout=120]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">同步发送数据</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">data</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example"> 数据
              此处传入的数据长度和剩余可用内存有关，只要内存够用，可以随便传入数据
              虽然说此处的数据长度没有特别限制，但是调用core中的socket发送接口时，每次最多发送11200字节的数据
              例如此处传入的data长度是112000字节，则在这个send接口中，会循环10次，每次发送11200字节的数据</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 120]
        <pre class="example"> 可选参数，发送超时时间，单位秒</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">result true - 成功，false - 失败</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">socketClient = socket.tcp()
socketClient:connect(<span class="string">"www.baidu.com"</span>,<span class="string">"80"</span>)
socketClient:send(<span class="string">"12345678"</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "mt:recv"></a>
    <strong  style="color: red;">
    mt:recv (<strong  style="color: green;">[timeout=0]</strong><strong  style="color: green;">[, msg=nil]</strong><strong  style="color: green;">[, msgNoResume=nil]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">同步接收数据</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 0]
        <pre class="example"> 可选参数，接收超时时间，单位毫秒</pre>
        </li>
        <li><span class="parameter">msg</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example"> 可选参数，控制socket所在的线程退出recv阻塞状态</pre>
        </li>
        <li><span class="parameter">msgNoResume</span>
            <span class="types"><span class="type">bool</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example"> 可选参数，控制socket所在的线程退出recv阻塞状态
                false或者nil表示“在recv阻塞状态，收到msg消息，可以退出阻塞状态”，true表示不退出
                此参数仅lib内部使用，应用脚本不要使用此参数</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>
        <li>
        <pre class="example"> result 数据接收结果
                true表示成功（接收到了数据）
                false表示失败（没有接收到数据）</pre></li>
        <li>
        <pre class="example"> data
                如果result为true，data表示接收到的数据(如果是UDP，返回最新的一包数据；如果是TCP,返回所有收到的数据)
                如果result为false，超时失败，data为"timeout"
                如果result为false，msg控制退出，data为msg的字符串
                如果result为false，socket连接被动断开控制退出，data为"CLOSED"
                如果result为false，PDP断开连接控制退出，data为"IP_ERROR_IND"</pre></li>
        <li>
        <pre class="example">param 如果是msg控制退出，param的值是msg的参数</pre></li>
    </ol>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">socketClient = socket.tcp()
socketClient:connect(<span class="string">"www.baidu.com"</span>,<span class="string">"80"</span>)
result,data = socketClient:recv(<span class="number">60000</span>,<span class="string">"APP_SOCKET_SEND_DATA"</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "mt:close"></a>
    <strong  style="color: red;">
    mt:close ()
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">主动关闭并且销毁一个socket</pre>



    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">socketClient = socket.tcp()
socketClient:connect(<span class="string">"www.baidu.com"</span>,<span class="string">"80"</span>)
socketClient:close()</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "setTcpResendPara"></a>
    <strong  style="color: red;">
    setTcpResendPara (<strong  style="color: green;">[retryCnt=4]</strong><strong  style="color: green;">[, retryMaxTimeout=16]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">设置TCP层自动重传的参数</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">retryCnt</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 4]
        <pre class="example">重传次数；取值范围0到12</pre>
        </li>
        <li><span class="parameter">retryMaxTimeout</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 16]
        <pre class="example">限制每次重传允许的最大超时时间(单位秒)，取值范围1到16</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">setTcpResendPara(<span class="number">3</span>,<span class="number">8</span>)
setTcpResendPara(<span class="number">4</span>,<span class="number">16</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "setDnsParsePara"></a>
    <strong  style="color: red;">
    setDnsParsePara (<strong  style="color: green;">[retryCnt=4]</strong><strong  style="color: green;">[, retryTimeoutMulti=4]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">设置域名解析参数
 注意：0027以及之后的core版本才支持此功能</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">retryCnt</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 4]
        <pre class="example">重传次数；取值范围1到8</pre>
        </li>
        <li><span class="parameter">retryTimeoutMulti</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 4]
        <pre class="example">重传超时时间倍数，取值范围1到5
                第n次重传超时时间的计算方式为：第n次的重传超时基数*retryTimeoutMulti，单位为秒
                重传超时基数表为{1, 1, 2, 4, 4, 4, 4, 4}
                第1次重传超时时间为：1*retryTimeoutMulti 秒
                第2次重传超时时间为：1*retryTimeoutMulti 秒
                第3次重传超时时间为：2*retryTimeoutMulti 秒
                ...........................................
                第8次重传超时时间为：8*retryTimeoutMulti 秒</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">socket.setDnsParsePara(<span class="number">8</span>,<span class="number">5</span>)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "printStatus"></a>
    <strong  style="color: red;">
    printStatus ()
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">打印所有socket的状态</pre>



    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">无</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">socket.printStatus()</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "setLowPower"></a>
    <strong  style="color: red;">
    setLowPower (tm)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">设置数据传输后，允许进入休眠状态的延时时长
 3024版本以及之后的版本才支持此功能
 此功能设置的参数，设置成功后，掉电会自动保存</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">tm</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">数据传输后，允许进入休眠状态的延时时长，单位为秒，取值范围1到20
             注意：此时间越短，允许进入休眠状态越快，功耗越低；但是在某些网络环境中，此时间越短，可能会造成数据传输不稳定
                   建议在可以接受的功耗范围内，此值设置的越大越好
                   如果没有设置此参数，此延时时长是和基站的配置有关，一般来说是10秒左右</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">socket.setLowPower(<span class="number">5</span>)</pre></il>
    </ul>

</dd>
</dl>
    <h2 class="section-header "><a name="Fields"></a>Fields</h2>

    <dl class="function">
    <dt>
    <a name = "isReady"></a>
    <strong  style="color: red;">
    isReady
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">SOCKET 是否有可用</pre>







</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2021-08-02 13:53:19 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

